package com.rs.admin.com.rs.control;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @ClassName MyConfig
 * @Description: TODO
 * @Author zlx
 * @Date 2020/5/14
 * @Version V1.0
 **/
@Configuration
public class MyConfig implements WebMvcConfigurer {

    public void addInterceptors(InterceptorRegistry registry) {
        /**
         * 可以添加多个拦截器
         */
        registry.addInterceptor(new VisitLimitInterceptor()).addPathPatterns("/**");
        /**
         * 也可以添加多个拦截器
         * registry.addInterceptor(new HttpInterceptor1());
         */
    }
}